Page({
  data: {
    settings: {
      notification: true,
      autoPlay: false
    },
    cacheSize: '2.5MB',
    version: '1.0.2'
  },

  toggleNotification(e) {
    this.setData({
      'settings.notification': e.detail.value
    })
  },

  toggleAutoPlay(e) {
    this.setData({
      'settings.autoPlay': e.detail.value
    })
  },

  logout() {
    wx.showModal({
      title: '提示',
      content: '确定要退出登录吗？',
      success: (res) => {
        if (res.confirm) {
          wx.clearStorageSync()
          wx.reLaunch({
            url: '/pages/login/login'
          })
        }
      }
    })
  }
}) 